package com.wrk._1_语法._04_循环._01_单循环;

import java.util.Scanner;

public class _011_求阶乘 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个数");
        int sum = scanner.nextInt();
        int factorial =1;
        for (int a =1; a<=sum;a++){
            factorial=a*factorial;
        }
        System.out.println(sum+"的阶乘是："+factorial);
        scanner.close();
    }
}
